/*
*    FileName: tcpclientsocket.h
* Description:
*     Version: 1.0
*      Author: wulin
*/
#ifndef TCPCLIENTSOCKET_H
#define TCPCLIENTSOCKET_H

#include <QTcpSocket>
#include <QHostAddress>
#include "protocal.h"
//class WeatherStation;

class   QSqlQuery;

/***每个该类的对象对应一条与TCP server建立的连接****/
class tcpClientSocket : public QTcpSocket
{
    Q_OBJECT
public:
    explicit tcpClientSocket(QObject *parent = 0);
   ~tcpClientSocket();
    QByteArray tcpPacket;
    QHostAddress myPeerAddr;
    quint16 myPeerPort;
private:
    QByteArray* temp; //接收到的数据。当收到完整的包时，清楚数据
    QMap <QString, Protocal> mapHeadProtocal;
private slots:
    void readClient();
signals:
    void sigErrorInfo(QString errorStr);

};

#endif // TCPCLIENTSOCKET_H
